﻿package server;

import java.rmi.RemoteException;
import java.sql.SQLException;

public class ResManagement {

	public ResManagement() {
		super();
	}

	private static double profit;
	
//	static int TOTALSEATS=100;
//	private boolean Full;
//	static int NumOfStaff=100;
	
	private ResTable table;
	private ResStaffList staff;
//	static ResTable[] table=new ResTable[TOTALSEATS];
	

	

	
/*	static{
		
		for(int i=0;i<TOTALSEATS/3;i++){
			table[i]=new ResTable(i+1,1);
		}
		for(int i=TOTALSEATS/3;i<(TOTALSEATS/3)*2;i++){
			table[i]=new ResTable(i+1,2);
		}
		for(int i=(TOTALSEATS/3)*2;i<TOTALSEATS;i++){
			table[i]=new ResTable(i+1,3);
		}
	}
*/
	public double getProfit() {
		return profit;
	}

	public void setProfit(double d) {
		this.profit += d;
	}

	
	public void salaryPayment()
	{
		double sum=0.0;
		ResStaffList staffList;
		try {
			staffList = new ResStaffList();
		
		
		for(int i=1;i<=staffList.getListSize();i++)
		{
			//将钱加入个人账户 或者 直接现金
			sum+=staffList.getSalary(i);
		}} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		profit=profit-sum;
	}


	public void addTable(int number,int size) throws SQLException, RemoteException
	{
		table.addTableNumber(number,size);
	}
	
	public void addStaff(int number,int kind,String name,int sex,int age,double salary)
	{
		try {
			staff=new ResStaffList();
			staff.addStaff(kind,name,sex,age,salary);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
/*	public boolean isFull() {
		return Full;
	}

	public void setFull(boolean full) {
		Full = full;
	}
	
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.print(TOTALSEATS);
	}
*/	

}
